import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.List;

public class TestJsonParsing {
    public static void main(String[] args) {
        ObjectMapper objectMapper = new ObjectMapper();
        
        // 测试数据库中的JSON数据
        String jsonString = "[5]";
        
        try {
            List<Long> typeIds = objectMapper.readValue(jsonString, new TypeReference<List<Long>>() {});
            System.out.println("Parsed type IDs: " + typeIds);
            
            if (typeIds != null && !typeIds.isEmpty()) {
                System.out.println("First type ID: " + typeIds.get(0));
            }
        } catch (Exception e) {
            System.out.println("Error parsing JSON: " + e.getMessage());
            e.printStackTrace();
        }
    }
}
